<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>赛维科技--金融服务平台</title>
<link rel="stylesheet" type="text/css" href="${base}/res/saiwei_template/css/login.css"/>
<link href="${base}/res/betou_template/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/res/betou_template/js/jquery.js"></script>
<script type="text/javascript" src="${base}/res/betou_template/js/common.js"></script>

<script type="text/javascript">
	if (self != top) { // 登录页面若在框架内，则跳出框架
		top.location = self.location;
	};
	$().ready( function() {
		<#if errors??>
			var error = "<#list errors as e>${e}</#list>";
			$.message("error", error);
		</#if>
		var $loginForm = $("#loginForm");
		var $enPassword = $("#enPassword");
		var $username = $("#username");
		var $password = $("#password");
		var $captcha = $("#captcha");
		var $captchaImage = $("#captchaImage");
		var $isRememberUsername = $("#isRememberUsername");
		
		// 记住用户名
		if(getCookie("adminUsername") != null) {
			$isRememberUsername.prop("checked", true);
			$username.val(getCookie("adminUsername"));
			$password.focus();
		} else {
			$isRememberUsername.prop("checked", false);
			$username.focus();
		}
		
		// 更换验证码
		$captchaImage.click( function() {
			$captchaImage.attr("src", "${base}/captcha.svl?timestamp=" + (new Date()).valueOf());
		});
		
		// 表单验证、记住用户名
		$loginForm.submit( function() {
			if ($username.val() == "") {
				$.message("warn", "请输入您的用户名");
				return false;
			}
			if ($password.val() == "") {
				$.message("warn","请输入您的密码");
				return false;
			}
			
			if ($captcha.val() == "") {
				$.message("warn","请输入您的验证码");
				return false;
			}
			
			if ($isRememberUsername.prop("checked")) {
				addCookie("adminUsername", $username.val(), {expires: 7 * 24 * 60 * 60});
			} else {
				removeCookie("adminUsername");
			}
		});
	});
</script>

</head>

<body>
<div class="logo"></div>
<div class="main">
	<span class="shadow"></span>
	<form id="loginForm" action="login.jspx" method="post">
	<#if returnUrl??><input type="hidden" name="returnUrl" value="${returnUrl}"/></#if>
	<#if processUrl??><input type="hidden" name="processUrl" value="${processUrl}"/></#if>
	<div class="loginTop"></div>
    <div class="loginCenter">
    	<div class="txt"><label>用户名:</label><input type="text" id="username" name="username" class="userText" value="${username!}" maxlength="30" /></div>
        <div class="txt"><label>密&nbsp;&nbsp;码:</label><input type="password" id="password" name="password" class="userText"  autocomplete="off" /></div>
        <div class="txt"><label>验证码:</label><input type="text" id="captcha" name="captcha" class="pwdText" maxlength="4" autocomplete="off" /></div>
        <div class="txt"><label></label><input type="checkbox" id="isRememberUsername" value="true" />记住用户名</div>
        <a href="##" class="codeImg"><img id="captchaImage" class="captchaImage" src="${base}/captcha.svl" title="点击更换验证码" /></a>
        <div class="login"><input value="" class="loginBtn" type="submit" /></div>
        <div class="pwd"><input value="" class="pwdBtn" type="button" /></div>
    </div>
    <div class="loginBtm">© 湖南赛维软件技术有限公司</div>
    <div class="loginY"></div>
    </form>
</div>
</body>
</html>

